import request from "@/utils/request";

export function getDepartment(id) {
  return request({
    url: "/api/identity/departments/" + id,
    method: "get",
    authServer: true,
  });
}

export function getDepartments(paramters) {
  return request({
    url: "/api/identity/departments",
    method: "get",
    params: paramters,
    authServer: true,
  });
}

export function addDepartment(data) {
  return request({
    url: "/api/identity/departments",
    method: "post",
    data: data,
    authServer: true,
  });
}

export function updateDepartment(data) {
  return request({
    url: "/api/identity/departments",
    method: "put",
    data: data,
    authServer: true,
  });
}

export function deleteDepartment(id) {
  return request({
    url: "/api/identity/departments/" + id,
    method: "delete",
    authServer: true,
  });
}
